﻿Imports Hinshelwood.TFSStickyBuddy.Modules.Interfaces
Imports Hinshelwood.TFSStickyBuddy.Modules.PresentationModels
Imports Hinshelwood.TFSStickyBuddy.Infrastructure
Imports Microsoft.Practices.Unity
Imports Microsoft.Practices.Composite.Events
Imports Hinshelwood.TFSStickyBuddy.Infrastructure.Events

Namespace Presenters

    Public Class ConnectedToServerPresenter
        Implements IConnectedToPresenter

        Private m_View As IConnectedToView
        Private m_Container As IUnityContainer
        Private ReadOnly m_eventAggregator As IEventAggregator
        Private ReadOnly m_NotImplementedEvent As NotImplementedEvent

        Public ReadOnly Property View() As IConnectedToView Implements IConnectedToPresenter.View
            Get
                Return m_View
            End Get
        End Property

        Public Sub New(ByVal view As IConnectedToView, ByVal container As IUnityContainer, ByVal eventAggregator As IEventAggregator)
            m_View = view
            m_Container = container
            m_eventAggregator = eventAggregator
            m_NotImplementedEvent = m_eventAggregator.GetEvent(Of NotImplementedEvent)()
        End Sub

        Public Sub ShowView() Implements Interfaces.IConnectedToPresenter.ShowView
            View.Model = m_Container.Resolve(Of ITeamSystemSelectionPresentationModel)()
        End Sub

    End Class

End Namespace